<template>
    <!-- 返回导航 -->
    <van-nav-bar
        title="搜索"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft"
    />
    <!-- 搜索框 -->
    <form action="/">
        <van-search
            v-model="useSearch.searchData"
            show-action
            placeholder="请输入搜索关键词"
            @search="onSearch"
            @cancel="onCancel"
            @click="onClickSearch"
        />
    </form>
    <!-- 搜索默认区 -->
    <DefaultSearch></DefaultSearch>
    <!-- 搜索内容 -->
    <SearchDetail v-if="useSearch.showSearch"></SearchDetail>
</template>

<script setup lang="ts">
import SearchDetail from '@/views/platform/search/SearchDetail.vue'
import DefaultSearch from '@/views/platform/search/DefaultSearch.vue'
import { useSearchFn,useSearch} from '@/hooks/search'
const {onClickLeft,onSearch,onCancel,onClickSearch} = useSearchFn()

</script>

<style lang="scss" scoped></style>
